<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
    <template v-if="!loading">
            <el-col :span="24" >
                <el-form-item  label="来访事由"  
 prop="visitname" >
                        <p>{{dataForm.visitname}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="来访单位"  
 prop="visitcompany" >
                        <p>{{dataForm.visitcompany}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="来访人员姓名"  
 prop="visituser" >
                        <p>{{dataForm.visituser}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="入闸时间"  
 prop="intime" >
                        <p>{{dataForm.intime}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="来访联系人电话"  
 prop="mobile" >
                        <p>{{dataForm.mobile}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="出闸时间"  
 prop="outtime" >
                        <p>{{dataForm.outtime}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="被访者姓名"  
 prop="calluer" >
                        <p>{{dataForm.calluer}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="被访者部门"  
 prop="calldepartid" >
                        <p>{{dataForm.calldepartid}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="被访者联系电话"  
 prop="callmobile" >
                        <p>{{dataForm.callmobile}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="来访时间"  
 prop="time" >
                        <p>{{dataForm.time}}</p>
                </el-form-item>
            </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'
    import PrintBrowse from '@/components/PrintBrowse'
    import jnpf from '@/utils/jnpf'
    export default {
        components: {PrintBrowse},
        props: [],
        data() {
            return {
                visible: false,
                loading: false,
                printBrowseVisible: false,
                printId: '',
            dataForm: {
                id :'',
                            visitname : '',
                            visitcompany : '',
                            visituser : '',
                            intime : '',
                            mobile : '',
                            outtime : '',
                            qrcode : '',
                            calluer : '',
                            calldepartid : '',
                            callmobile : '',
                            time : "",
            },

        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            dataInfo(dataAll){
                let _dataAll =dataAll
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/example/BusVisit/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
